#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
void main()
{
	int gdriver=DETECT,gmode,i,j,k;
	FILE *file;
	clrscr();
	unsigned char s[1],font[8];
	unsigned char st[4];
	unsigned char r;
	initgraph(&gdriver,&gmode,"");
	file=fopen("FONT.TXT","w");
	delay(3000);
	for(k=0;k<256;k++)	{
		s[0]=k;
		cleardevice();
		outtextxy(0,0,s);
		for(j=0;j<8;j++)	{
			font[j]=0;
			for(i=0;i<8;i++)	{
				if(getpixel(i,j)==15)
					font[j]|=(1<<i);
			}
			st[3]=',';
			st[0]=0x30+font[j]/100;
			st[1]=0x30+(font[j]%100)/10;
			st[2]=0x30+((font[j]%100)%10);
			fwrite(st,1,4,file);
		}
		delay(5);
	}
	closegraph();
	fclose(file);
	getch();
}